import { Type } from 'class-transformer'
import { IsEnum, IsNotEmpty, IsNumber } from 'class-validator'
import i18n from '@/i18n'
import { DomainModel } from '@apps/meta/domain/model'
import { ApiProperty } from '@nestjs/swagger'

export class MetaResourceModelListDto {
  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-model-list.12151140-0') })
  @IsNotEmpty()
  @IsNumber()
  @Type(() => Number)
  relativeId: number

  @ApiProperty({
    description: i18n.t('app-meta.dto.meta-resource-model-list.12151140-1'),
    enum: DomainModel.ApiPropertyEnum.MetaResourceRelativeType,
  })
  @IsNotEmpty()
  @IsEnum(DomainModel.MetaResourceRelativeType)
  relativeType: DomainModel.MetaResourceRelativeType

  @ApiProperty({
    description: i18n.t('app-meta.dto.meta-resource-model-list.12151140-2'),
    enum: DomainModel.ApiPropertyEnum.MetaResourceModelType,
  })
  @IsEnum(DomainModel.MetaResourceModelType)
  type?: DomainModel.MetaResourceModelType
}
